<?php

namespace App\Http\Queries;

use App\Models\Admin\AdminRole;
use Spatie\QueryBuilder\AllowedFilter;

class AdminRoleQuery extends BaseQuery
{

    public function __construct()
    {
        // 字符搜索
        $this->strSearch = ['role_content'];
        // 等值搜索
        $this->eqSearch = ['role_id', 'role_name'];
        // 时间搜索
        $this->timeSearch = ['start_time', 'end_time'];
        $this->timeAttribute = 'created_at';

        parent::__construct(AdminRole::query());

        $this->toOrderBy();
    }
}
